home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / mxlibs / gusdk222 / examples / modfil10.txt
Text File  |  1993-11-12  |  67KB  |  2,164 lines

  1. indVesaMode(xsize,ysize,24);
  2.     END;
  3.     IF mode = 0 THEN BEGIN
  4.         WriteLn('No such mode could be found !');
  5.         WriteLn('Switching to to 320x200.');
  6.         ReadKey;
  7.         mode := V320x200x256;
  8.     END;
  9. END;
  10.  
  11. begin { program body }
  12.   SelectMode;
  13.   Initialize;
  14.   ReportStatus;
  15.  
  16. {  AspectRatioPlay; }
  17.   FillEllipsePlay;
  18.   SectorPlay;
  19.   WriteModePlay;
  20.  
  21.   ColorPlay;
  22.   { PalettePlay only intended to work on these drivers: }
  23.   if (GraphDriver = EGA) or
  24.       (GraphDriver = EGA64) or
  25.       (GraphDriver = VGA) then
  26.      PalettePlay;
  27.   PutPixelPlay;
  28. {  PutImagePlay; }
  29.   RandBarPlay;
  30.   BarPlay;
  31.   Bar3DPlay;
  32.   ArcPlay;
  33.   CirclePlay;
  34.   PiePlay;
  35.   LineToPlay;
  36.   LineRelPlay;
  37. {  LineStylePlay; }
  38. {  UserLineStylePlay; }
  39.   TextDump;
  40.   TextPlay;
  41.   CrtModePlay;
  42.   FillStylePlay;
  43.   FillPatternPlay;
  44.   PolyPlay;
  45.   SayGoodbye;
  46. {  CloseGraph; }
  47.   CloseVesa;
  48. end.
  49. ***************************************************
  50.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  51.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  52. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  53. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  54.     Color := RandColor;
  55.     SetColor(Color);
  56.     SetFillStyle(Random(CloseDotFill)+1, Color);
  57.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  58.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  59.   until KeyPressed;
  60.   WaitToGo;
  61. end; { RandBarPlay }
  62.  
  63. procedure ArcPlay;
  64. { Draw random arcs on the screen }
  65. var
  66.   MaxRadius : word;
  67.   EndAngle : word;
  68.   ArcInfo : ArcCoordsType;
  69. begin
  70.   MainWindow('Arc / GetArcCoords demonstration');
  71.   StatusLine('Esc aborts or press a key');
  72.   MaxRadius := MaxY div 10;
  73.   repeat
  74.     SetColor(RandColor);
  75.     EndAngle := Random(360);
  76.     SetLineStyle(SolidLn, 0, NormWidth);
  77.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  78.     GetArcCoords(ArcInfo);
  79.     with ArcInfo do
  80.     begin
  81.       Line(X, Y, XStart, YStart);
  82.       Line(X, Y, Xend, Yend);
  83.     end;
  84.   until KeyPressed;
  85.   WaitToGo;
  86. end; { ArcPlay }
  87.  
  88. procedure PutPixelPlay;
  89. { Demonstrate the PutPixel and GetPixel commands }
  90. const
  91.   Seed   = 1962; { A seed for the random number generator }
  92.   NumPts = 2000; { The number of pixels plotted }
  93.   Esc    = #27;
  94. var
  95.   I : word;
  96.   X, Y, Color : word;
  97.   XMax, YMax  : integer;
  98.   ViewInfo    : ViewPortType;
  99. begin
  100.   MainWindow('PutPixel / GetPixel demonstration');
  101.   StatusLine('Esc aborts or press a key...');
  102.  
  103.   GetViewSettings(ViewInfo);
  104.   with ViewInfo do
  105.   begin
  106.     XMax := (x2-x1-1);
  107.     YMax := (y2-y1-1);
  108.   end;
  109.  
  110.   while not KeyPressed do
  111.   begin
  112.     { Plot random pixels }
  113.     RandSeed := Seed;
  114.     I := 0;
  115.     while (not KeyPressed) and (I < NumPts) do
  116.     begin
  117.       Inc(I);
  118.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  119.     end;
  120.  
  121.     { Erase pixels }
  122.     RandSeed := Seed;
  123.     I := 0;
  124.     while (not KeyPressed) and (I < NumPts) do
  125.     begin
  126.       Inc(I);
  127.       X := Random(XMax)+1;
  128.       Y := Random(YMax)+1;
  129.       Color := GetPixel(X, Y);
  130.         if Color = RandColor then
  131.           PutPixel(X, Y, 0);
  132.      end;
  133.   end;
  134.   WaitToGo;
  135. end; { PutPixelPlay }
  136.  
  137. procedure PutImagePlay;
  138. { Demonstrate the GetImage and PutImage commands }
  139.  
  140. const
  141.   r  = 20;
  142.   StartX = 100;
  143.   StartY = 50;
  144.  
  145. var
  146.   CurPort : ViewPortType;
  147.  
  148. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  149. var
  150.   Step : integer;
  151. begin
  152.   Step := Random(2*r);
  153.   if Odd(Step) then
  154.     Step := -Step;
  155.   X := X + Step;
  156.   Step := Random(r);
  157.   if Odd(Step) then
  158.     Step := -Step;
  159.   Y := Y + Step;
  160.  
  161.   { Make saucer bounce off viewport walls }
  162.   with CurPort do
  163.   begin
  164.     if (x1 + X + Width - 1 > x2) then
  165.       X := x2-x1 - Width + 1
  166.     else
  167.       if (X < 0) then
  168.         X := 0;
  169.     if (y1 + Y + Height - 1 > y2) then
  170.       Y := y2-y1 - Height + 1
  171.     else
  172.       if (Y < 0) then
  173.         Y := 0;
  174.   end;
  175. end; { MoveSaucer }
  176.  
  177. var
  178.   Pausetime : word;
  179.   Saucer    : pointer;
  180.   X, Y      : integer;
  181.   ulx, uly  : word;
  182.   lrx, lry  : word;
  183.   Size      : word;
  184.   I         : word;
  185. begin
  186.   ClearDevice;
  187.   FullPort;
  188.  
  189.   { PaintScreen }
  190.   ClearDevice;
  191.   MainWindow('GetImage / PutImage Demonstration');
  192.   StatusLine('Esc aborts or press a key...');
  193.   GetViewSettings(CurPort);
  194.  
  195.   { DrawSaucer }
  196.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  197.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  198.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  199.   Circle(StartX+10, StartY-12, 2);
  200.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  201.   Circle(StartX-10, StartY-12, 2);
  202.   SetFillStyle(SolidFill, MaxColor);
  203.   FloodFill(StartX+1, StartY+4, GetColor);
  204.  
  205.   { ReadSaucerImage }
  206.   ulx := StartX-(r+1);
  207.   uly := StartY-14;
  208.   lrx := StartX+(r+1);
  209.   lry := StartY+(r div 3)+3;
  210.  
  211.   Size := ImageSize(ulx, uly, lrx, lry);
  212.   GetMem(Saucer, Size);
  213.   GetImage(ulx, uly, lrx, lry, Saucer^);
  214. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  215.  
  216.   { Plot some "stars" }
  217.   for I := 1 to 1000 do
  218.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  219.   X := MaxX div 2;
  220.   Y := MaxY div 2;
  221.   PauseTime := 70;
  222.  
  223.   { Move the saucer around }
  224.   repeat
  225. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  226.      Delay(PauseTime);
  227. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  228.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  229.   until KeyPressed;
  230.   FreeMem(Saucer, size);
  231.   WaitToGo;
  232. end; { PutImagePlay }
  233.  
  234. procedure PolyPlay;
  235. { Draw random polygons with random fill styles on the screen }
  236. const
  237.   MaxPts = 5;
  238. type
  239.   PolygonType = array[1..MaxPts] of PointType;
  240. var
  241.   Poly : PolygonType;
  242.   I, Color : word;
  243. begin
  244.   MainWindow('FillPoly demonstration');
  245.   StatusLine('Esc aborts or press a key...');
  246.   repeat
  247.     Color := RandColor;
  248.     SetFillStyle(Random(11)+1, Color);
  249.     SetColor(Color);
  250.     for I := 1 to MaxPts do
  251.       with Poly[I] do
  252.       begin
  253.         X := Random(MaxX);
  254.         Y := Random(MaxY);
  255.       end;
  256.     FillPoly(MaxPts, Poly);
  257.   until KeyPressed;
  258.   WaitToGo;
  259. end; { PolyPlay }
  260.  
  261. procedure FillStylePlay;
  262. { Display all of the predefined fill styles available }
  263. var
  264.   Style    : word;
  265.   Width    : word;
  266.   Height   : word;
  267.   X, Y     : word;
  268.   I, J     : word;
  269.   ViewInfo : ViewPortType;
  270.  
  271. procedure DrawBox(X, Y : word);
  272. begin
  273.   SetFillStyle(Style, MaxColor);
  274.   with ViewInfo do
  275.     Bar(X, Y, X+Width, Y+Height);
  276.   Rectangle(X, Y, X+Width, Y+Height);
  277.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  278.   Inc(Style);
  279. end; { DrawBox }
  280.  
  281. begin
  282.   MainWindow('Pre-defined fill styles');
  283.   GetViewSettings(ViewInfo);
  284.   with ViewInfo do
  285.   begin
  286.     Width := 2 * ((x2+1) div 13);
  287.     Height := 2 * ((y2-10) div 10);
  288.   end;
  289.   X := Width div 2;
  290.   Y := Height div 2;
  291.   Style := 0;
  292.   for J := 1 to 3 do
  293.   begin
  294.     for I := 1 to 4 do
  295.     begin
  296.       DrawBox(X, Y);
  297.       Inc(X, (Width div 2) * 3);
  298.     end;
  299.     X := Width div 2;
  300.     Inc(Y, (Height div 2) * 3);
  301.   end;
  302.   SetTextJustify(LeftText, TopText);
  303.   WaitToGo;
  304. end; { FillStylePlay }
  305.  
  306. procedure FillPatternPlay;
  307. { Display some user defined fill patterns }
  308. const
  309.   Patterns : array[0..11] of FillPatternType = (
  310.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  311.             OldColor which has a path of pixels of OldColor or NewColor
  312.             with sides touching back to the seed point, (XSeed, YSeed).
  313.             Therefore, only pixels of OldColor are modified and no other
  314.             information is changed.
  315.  
  316.             SEE ALSO
  317.  
  318.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  319.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  320.             SETVIEW
  321.  
  322.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  323.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  324.             IF WHICHVGA = 0 THEN STOP
  325.             DUMMY=RES640
  326.             SETVIEW 100, 100, 539, 379
  327.             FILLVIEW 10
  328.             WHILE INKEY$ = ""
  329.             WEND
  330.             VIDEOMODESET VMODE
  331.             END
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.                                                                          63
  349.  
  350.  
  351.  
  352.  
  353.  
  354.           FONTGETINFO
  355.  
  356.             PROTOTYPE
  357.  
  358.             SUB FONTGETINFO (Width%, Height%)
  359.  
  360.             INPUT
  361.  
  362.             no input parameters
  363.     WEND
  364.             MOUSEEXIT
  365.             VIDEOMODESET VMODE
  366.             END
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.                                                                          86
  408.  
  409.  
  410.  
  411.  
  412.  
  413.           MOUSECURSORDEFAULT
  414.  
  415.             PROTOTYPE
  416.  
  417.             SUB MOUSECURSORDEFAULT ()
  418.  
  419.             INPUT
  420.  
  421.             no input parameters
  422.  
  423.             OUTPUT
  424.  
  425.             no value returned
  426.  
  427.             USAGE
  428.  
  429.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  430.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  431. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  432. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  433. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  434. $╤
  435. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  436. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  437. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  438.       end;
  439.     end;
  440.   end;
  441.   WaitToGo;
  442. end; { UserLineStylePlay }
  443.  
  444.  
  445. procedure SayGoodbye;
  446. { Say goodbye and then exit the program }
  447. var
  448.   ViewInfo : ViewPortType;
  449. begin
  450.   MainWindow('');
  451.   GetViewSettings(ViewInfo);
  452.   SetTextStyle(TriplexFont, HorizDir, 4);
  453.   SetTextJustify(CenterText, CenterText);
  454.   with ViewInfo do
  455.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  456.   StatusLine('Press any key to quit...');
  457.   repeat until KeyPressed;
  458. end; { SayGoodbye }
  459.  
  460.  
  461. PROCEDURE SelectMode;
  462. VAR
  463.     choice1,choice2     : CHAR;
  464.    xsize,ysize            : WORD;
  465. BEGIN
  466.     (* Let's select a mode *)
  467.     ClrScr;
  468.     WriteLn('VESADEMO:');
  469.     WriteLn('1. 256 colors');
  470.     WriteLn('2. 32768 colors');
  471.     WriteLn('3. 65536 colors');
  472.     WriteLn('4. 16777216 colors');
  473.     WriteLn('Q uit');
  474.     WriteLn;
  475.     Write('Your choice: ');
  476.     REPEAT
  477.         ReadLn(choice1);
  478.       IF choice1 <> '1' THEN BEGIN
  479.           WriteLn('Sorry !');
  480.          WriteLn('This demo wasn''t written for more as 256 colors !');
  481.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  482.          WriteLn('Switching to 256 colors.');
  483.          choice1 := '1';
  484.       END;
  485.     UNTIL choice1 IN ['1'..'4','q'];
  486.     IF choice1 = 'q' THEN Halt;
  487.  
  488.     WriteLn;
  489.     WriteLn;
  490.     WriteLn('a. 320x200');
  491.     WriteLn('b. 640x480');
  492.     WriteLn('c. 800x600');
  493.     WriteLn('d. 1024x768');
  494.     WriteLn('e. 1280x1024');
  495.     WriteLn('Q uit');
  496.     WriteLn;
  497.     Write('Your choice: ');
  498.     REPEAT
  499.         ReadLn(choice2);
  500.     UNTIL choice2 IN ['a'..'e','q'];
  501.     IF choice2 = 'q' THEN Halt;
  502.  
  503.     CASE choice2 OF
  504.         'a' : BEGIN
  505.             xsize := 320;
  506.             ysize := 200;
  507.         END;
  508.         'b' : BEGIN
  509.             xsize := 640;
  510.             ysize := 480;
  511.         END;
  512.         'c' : BEGIN
  513.             xsize := 800;
  514.             ysize := 600;
  515.         END;
  516.         'd' : BEGIN
  517.             xsize := 1024;
  518.             ysize := 768;
  519.         END;
  520.         'e' : BEGIN
  521.             xsize := 1280;
  522.             ysize := 1024;
  523.         END;
  524.     END;
  525.     CASE choice1 OF
  526.         '1' : mode := FindVesaMode(xsize,ysize,8);
  527.         '2' : mode := FindVesaMode(xsize,ysize,15);
  528.         '3' : mode := FindVesaMode(xsize,ysize,16);
  529.         '4' : mode := FindVesaMode(xsize,ysize,24);
  530.     END;
  531.     IF mode = 0 THEN BEGIN
  532.         WriteLn('No such mode could be found !');
  533.         WriteLn('Switching to to 320x200.');
  534.         ReadKey;
  535.         mode := V320x200x256;
  536.     END;
  537. END;
  538.  
  539. begin { program body }
  540.   SelectMode;
  541.   Initialize;
  542.   ReportStatus;
  543.  
  544. {  AspectRatioPlay; }
  545.   FillEllipsePlay;
  546.   SectorPlay;
  547.   WriteModePlay;
  548.  
  549.   ColorPlay;
  550.   { PalettePlay only intended to work on these drivers: }
  551.   if (GraphDriver = EGA) or
  552.       (GraphDriver = EGA64) or
  553.       (GraphDriver = VGA) then
  554.      PalettePlay;
  555.   PutPixelPlay;
  556. {  PutImagePlay; }
  557.   RandBarPlay;
  558.   BarPlay;
  559.   Bar3DPlay;
  560.   ArcPlay;
  561.   CirclePlay;
  562.   PiePlay;
  563.   LineToPlay;
  564.   LineRelPlay;
  565. {  LineStylePlay; }
  566. {  UserLineStylePlay; }
  567.   TextDump;
  568.   TextPlay;
  569.   CrtModePlay;
  570.   FillStylePlay;
  571.   FillPatternPlay;
  572.   PolyPlay;
  573.   SayGoodbye;
  574. {  CloseGraph; }
  575.   CloseVesa;
  576. end.
  577. ***************************************************
  578.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  579.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  580. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  581. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  582.     Color := RandColor;
  583.     SetColor(Color);
  584.     SetFillStyle(Random(CloseDotFill)+1, Color);
  585.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  586.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  587.   until KeyPressed;
  588.   WaitToGo;
  589. end; { RandBarPlay }
  590.  
  591. procedure ArcPlay;
  592. { Draw random arcs on the screen }
  593. var
  594.   MaxRadius : word;
  595.   EndAngle : word;
  596.   ArcInfo : ArcCoordsType;
  597. begin
  598.   MainWindow('Arc / GetArcCoords demonstration');
  599.   StatusLine('Esc aborts or press a key');
  600.   MaxRadius := MaxY div 10;
  601.   repeat
  602.     SetColor(RandColor);
  603.     EndAngle := Random(360);
  604.     SetLineStyle(SolidLn, 0, NormWidth);
  605.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  606.     GetArcCoords(ArcInfo);
  607.     with ArcInfo do
  608.     begin
  609.       Line(X, Y, XStart, YStart);
  610.       Line(X, Y, Xend, Yend);
  611.     end;
  612.   until KeyPressed;
  613.   WaitToGo;
  614. end; { ArcPlay }
  615.  
  616. procedure PutPixelPlay;
  617. { Demonstrate the PutPixel and GetPixel commands }
  618. const
  619.   Seed   = 1962; { A seed for the random number generator }
  620.   NumPts = 2000; { The number of pixels plotted }
  621.   Esc    = #27;
  622. var
  623.   I : word;
  624.   X, Y, Color : word;
  625.   XMax, YMax  : integer;
  626.   ViewInfo    : ViewPortType;
  627. begin
  628.   MainWindow('PutPixel / GetPixel demonstration');
  629.   StatusLine('Esc aborts or press a key...');
  630.  
  631.   GetViewSettings(ViewInfo);
  632.   with ViewInfo do
  633.   begin
  634.     XMax := (x2-x1-1);
  635.     YMax := (y2-y1-1);
  636.   end;
  637.  
  638.   while not KeyPressed do
  639.   begin
  640.     { Plot random pixels }
  641.     RandSeed := Seed;
  642.     I := 0;
  643.     while (not KeyPressed) and (I < NumPts) do
  644.     begin
  645.       Inc(I);
  646.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  647.     end;
  648.  
  649.     { Erase pixels }
  650.     RandSeed := Seed;
  651.     I := 0;
  652.     while (not KeyPressed) and (I < NumPts) do
  653.     begin
  654.       Inc(I);
  655.       X := Random(XMax)+1;
  656.       Y := Random(YMax)+1;
  657.       Color := GetPixel(X, Y);
  658.         if Color = RandColor then
  659.           PutPixel(X, Y, 0);
  660.      end;
  661.   end;
  662.   WaitToGo;
  663. end; { PutPixelPlay }
  664.  
  665. procedure PutImagePlay;
  666. { Demonstrate the GetImage and PutImage commands }
  667.  
  668. const
  669.   r  = 20;
  670.   StartX = 100;
  671.   StartY = 50;
  672.  
  673. var
  674.   CurPort : ViewPortType;
  675.  
  676. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  677. var
  678.   Step : integer;
  679. begin
  680.   Step := Random(2*r);
  681.   if Odd(Step) then
  682.     Step := -Step;
  683.   X := X + Step;
  684.   Step := Random(r);
  685.   if Odd(Step) then
  686.     Step := -Step;
  687.   Y := Y + Step;
  688.  
  689.   { Make saucer bounce off viewport walls }
  690.   with CurPort do
  691.   begin
  692.     if (x1 + X + Width - 1 > x2) then
  693.       X := x2-x1 - Width + 1
  694.     else
  695.       if (X < 0) then
  696.         X := 0;
  697.     if (y1 + Y + Height - 1 > y2) then
  698.       Y := y2-y1 - Height + 1
  699.     else
  700.       if (Y < 0) then
  701.         Y := 0;
  702.   end;
  703. end; { MoveSaucer }
  704.  
  705. var
  706.   Pausetime : word;
  707.   Saucer    : pointer;
  708.   X, Y      : integer;
  709.   ulx, uly  : word;
  710.   lrx, lry  : word;
  711.   Size      : word;
  712.   I         : word;
  713. begin
  714.   ClearDevice;
  715.   FullPort;
  716.  
  717.   { PaintScreen }
  718.   ClearDevice;
  719.   MainWindow('GetImage / PutImage Demonstration');
  720.   StatusLine('Esc aborts or press a key...');
  721.   GetViewSettings(CurPort);
  722.  
  723.   { DrawSaucer }
  724.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  725.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  726.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  727.   Circle(StartX+10, StartY-12, 2);
  728.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  729.   Circle(StartX-10, StartY-12, 2);
  730.   SetFillStyle(SolidFill, MaxColor);
  731.   FloodFill(StartX+1, StartY+4, GetColor);
  732.  
  733.   { ReadSaucerImage }
  734.   ulx := StartX-(r+1);
  735.   uly := StartY-14;
  736.   lrx := StartX+(r+1);
  737.   lry := StartY+(r div 3)+3;
  738.  
  739.   Size := ImageSize(ulx, uly, lrx, lry);
  740.   GetMem(Saucer, Size);
  741.   GetImage(ulx, uly, lrx, lry, Saucer^);
  742. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  743.  
  744.   { Plot some "stars" }
  745.   for I := 1 to 1000 do
  746.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  747.   X := MaxX div 2;
  748.   Y := MaxY div 2;
  749.   PauseTime := 70;
  750.  
  751.   { Move the saucer around }
  752.   repeat
  753. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  754.      Delay(PauseTime);
  755. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  756.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  757.   until KeyPressed;
  758.   FreeMem(Saucer, size);
  759.   WaitToGo;
  760. end; { PutImagePlay }
  761.  
  762. procedure PolyPlay;
  763. { Draw random polygons with random fill styles on the screen }
  764. const
  765.   MaxPts = 5;
  766. type
  767.   PolygonType = array[1..MaxPts] of PointType;
  768. var
  769.   Poly : PolygonType;
  770.   I, Color : word;
  771. begin
  772.   MainWindow('FillPoly demonstration');
  773.   StatusLine('Esc aborts or press a key...');
  774.   repeat
  775.     Color := RandColor;
  776.     SetFillStyle(Random(11)+1, Color);
  777.     SetColor(Color);
  778.     for I := 1 to MaxPts do
  779.       with Poly[I] do
  780.       begin
  781.         X := Random(MaxX);
  782.         Y := Random(MaxY);
  783.       end;
  784.     FillPoly(MaxPts, Poly);
  785.   until KeyPressed;
  786.   WaitToGo;
  787. end; { PolyPlay }
  788.  
  789. procedure FillStylePlay;
  790. { Display all of the predefined fill styles available }
  791. var
  792.   Style    : word;
  793.   Width    : word;
  794.   Height   : word;
  795.   X, Y     : word;
  796.   I, J     : word;
  797.   ViewInfo : ViewPortType;
  798.  
  799. procedure DrawBox(X, Y : word);
  800. begin
  801.   SetFillStyle(Style, MaxColor);
  802.   with ViewInfo do
  803.     Bar(X, Y, X+Width, Y+Height);
  804.   Rectangle(X, Y, X+Width, Y+Height);
  805.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  806.   Inc(Style);
  807. end; { DrawBox }
  808.  
  809. begin
  810.   MainWindow('Pre-defined fill styles');
  811.   GetViewSettings(ViewInfo);
  812.   with ViewInfo do
  813.   begin
  814.     Width := 2 * ((x2+1) div 13);
  815.     Height := 2 * ((y2-10) div 10);
  816.   end;
  817.   X := Width div 2;
  818.   Y := Height div 2;
  819.   Style := 0;
  820.   for J := 1 to 3 do
  821.   begin
  822.     for I := 1 to 4 do
  823.     begin
  824.       DrawBox(X, Y);
  825.       Inc(X, (Width div 2) * 3);
  826.     end;
  827.     X := Width div 2;
  828.     Inc(Y, (Height div 2) * 3);
  829.   end;
  830.   SetTextJustify(LeftText, TopText);
  831.   WaitToGo;
  832. end; { FillStylePlay }
  833.  
  834. procedure FillPatternPlay;
  835. { Display some user defined fill patterns }
  836. const
  837.   Patterns : array[0..11] of FillPatternType = (
  838.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  839.             OldColor which has a path of pixels of OldColor or NewColor
  840.             with sides touching back to the seed point, (XSeed, YSeed).
  841.             Therefore, only pixels of OldColor are modified and no other
  842.             information is changed.
  843.  
  844.             SEE ALSO
  845.  
  846.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  847.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  848.             SETVIEW
  849.  
  850.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  851.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  852.             IF WHICHVGA = 0 THEN STOP
  853.             DUMMY=RES640
  854.             SETVIEW 100, 100, 539, 379
  855.             FILLVIEW 10
  856.             WHILE INKEY$ = ""
  857.             WEND
  858.             VIDEOMODESET VMODE
  859.             END
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.                                                                          63
  877.  
  878.  
  879.  
  880.  
  881.  
  882.           FONTGETINFO
  883.  
  884.             PROTOTYPE
  885.  
  886.             SUB FONTGETINFO (Width%, Height%)
  887.  
  888.             INPUT
  889.  
  890.             no input parameters
  891.     WEND
  892.             MOUSEEXIT
  893.             VIDEOMODESET VMODE
  894.             END
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.                                                                          86
  936.  
  937.  
  938.  
  939.  
  940.  
  941.           MOUSECURSORDEFAULT
  942.  
  943.             PROTOTYPE
  944.  
  945.             SUB MOUSECURSORDEFAULT ()
  946.  
  947.             INPUT
  948.  
  949.             no input parameters
  950.  
  951.             OUTPUT
  952.  
  953.             no value returned
  954.  
  955.             USAGE
  956.  
  957.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  958.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  959. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  960. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  961. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  962. $╤
  963. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  964. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  965. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  966.       end;
  967.     end;
  968.   end;
  969.   WaitToGo;
  970. end; { UserLineStylePlay }
  971.  
  972.  
  973. procedure SayGoodbye;
  974. { Say goodbye and then exit the program }
  975. var
  976.   ViewInfo : ViewPortType;
  977. begin
  978.   MainWindow('');
  979.   GetViewSettings(ViewInfo);
  980.   SetTextStyle(TriplexFont, HorizDir, 4);
  981.   SetTextJustify(CenterText, CenterText);
  982.   with ViewInfo do
  983.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  984.   StatusLine('Press any key to quit...');
  985.   repeat until KeyPressed;
  986. end; { SayGoodbye }
  987.  
  988.  
  989. PROCEDURE SelectMode;
  990. VAR
  991.     choice1,choice2     : CHAR;
  992.    xsize,ysize            : WORD;
  993. BEGIN
  994.     (* Let's select a mode *)
  995.     ClrScr;
  996.     WriteLn('VESADEMO:');
  997.     WriteLn('1. 256 colors');
  998.     WriteLn('2. 32768 colors');
  999.     WriteLn('3. 65536 colors');
  1000.     WriteLn('4. 16777216 colors');
  1001.     WriteLn('Q uit');
  1002.     WriteLn;
  1003.     Write('Your choice: ');
  1004.     REPEAT
  1005.         ReadLn(choice1);
  1006.       IF choice1 <> '1' THEN BEGIN
  1007.           WriteLn('Sorry !');
  1008.          WriteLn('This demo wasn''t written for more as 256 colors !');
  1009.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  1010.          WriteLn('Switching to 256 colors.');
  1011.          choice1 := '1';
  1012.       END;
  1013.     UNTIL choice1 IN ['1'..'4','q'];
  1014.     IF choice1 = 'q' THEN Halt;
  1015.  
  1016.     WriteLn;
  1017.     WriteLn;
  1018.     WriteLn('a. 320x200');
  1019.     WriteLn('b. 640x480');
  1020.     WriteLn('c. 800x600');
  1021.     WriteLn('d. 1024x768');
  1022.     WriteLn('e. 1280x1024');
  1023.     WriteLn('Q uit');
  1024.     WriteLn;
  1025.     Write('Your choice: ');
  1026.     REPEAT
  1027.         ReadLn(choice2);
  1028.     UNTIL choice2 IN ['a'..'e','q'];
  1029.     IF choice2 = 'q' THEN Halt;
  1030.  
  1031.     CASE choice2 OF
  1032.         'a' : BEGIN
  1033.             xsize := 320;
  1034.             ysize := 200;
  1035.         END;
  1036.         'b' : BEGIN
  1037.             xsize := 640;
  1038.             ysize := 480;
  1039.         END;
  1040.         'c' : BEGIN
  1041.             xsize := 800;
  1042.             ysize := 600;
  1043.         END;
  1044.         'd' : BEGIN
  1045.             xsize := 1024;
  1046.             ysize := 768;
  1047.         END;
  1048.         'e' : BEGIN
  1049.             xsize := 1280;
  1050.             ysize := 1024;
  1051.         END;
  1052.     END;
  1053.     CASE choice1 OF
  1054.         '1' : mode := FindVesaMode(xsize,ysize,8);
  1055.         '2' : mode := FindVesaMode(xsize,ysize,15);
  1056.         '3' : mode := FindVesaMode(xsize,ysize,16);
  1057.         '4' : mode := FindVesaMode(xsize,ysize,24);
  1058.     END;
  1059.     IF mode = 0 THEN BEGIN
  1060.         WriteLn('No such mode could be found !');
  1061.         WriteLn('Switching to to 320x200.');
  1062.         ReadKey;
  1063.         mode := V320x200x256;
  1064.     END;
  1065. END;
  1066.  
  1067. begin { program body }
  1068.   SelectMode;
  1069.   Initialize;
  1070.   ReportStatus;
  1071.  
  1072. {  AspectRatioPlay; }
  1073.   FillEllipsePlay;
  1074.   SectorPlay;
  1075.   WriteModePlay;
  1076.  
  1077.   ColorPlay;
  1078.   { PalettePlay only intended to work on these drivers: }
  1079.   if (GraphDriver = EGA) or
  1080.       (GraphDriver = EGA64) or
  1081.       (GraphDriver = VGA) then
  1082.      PalettePlay;
  1083.   PutPixelPlay;
  1084. {  PutImagePlay; }
  1085.   RandBarPlay;
  1086.   BarPlay;
  1087.   Bar3DPlay;
  1088.   ArcPlay;
  1089.   CirclePlay;
  1090.   PiePlay;
  1091.   LineToPlay;
  1092.   LineRelPlay;
  1093. {  LineStylePlay; }
  1094. {  UserLineStylePlay; }
  1095.   TextDump;
  1096.   TextPlay;
  1097.   CrtModePlay;
  1098.   FillStylePlay;
  1099.   FillPatternPlay;
  1100.   PolyPlay;
  1101.   SayGoodbye;
  1102. {  CloseGraph; }
  1103.   CloseVesa;
  1104. end.
  1105. ***************************************************
  1106.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  1107.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  1108. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  1109. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  1110.     Color := RandColor;
  1111.     SetColor(Color);
  1112.     SetFillStyle(Random(CloseDotFill)+1, Color);
  1113.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  1114.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  1115.   until KeyPressed;
  1116.   WaitToGo;
  1117. end; { RandBarPlay }
  1118.  
  1119. procedure ArcPlay;
  1120. { Draw random arcs on the screen }
  1121. var
  1122.   MaxRadius : word;
  1123.   EndAngle : word;
  1124.   ArcInfo : ArcCoordsType;
  1125. begin
  1126.   MainWindow('Arc / GetArcCoords demonstration');
  1127.   StatusLine('Esc aborts or press a key');
  1128.   MaxRadius := MaxY div 10;
  1129.   repeat
  1130.     SetColor(RandColor);
  1131.     EndAngle := Random(360);
  1132.     SetLineStyle(SolidLn, 0, NormWidth);
  1133.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  1134.     GetArcCoords(ArcInfo);
  1135.     with ArcInfo do
  1136.     begin
  1137.       Line(X, Y, XStart, YStart);
  1138.       Line(X, Y, Xend, Yend);
  1139.     end;
  1140.   until KeyPressed;
  1141.   WaitToGo;
  1142. end; { ArcPlay }
  1143.  
  1144. procedure PutPixelPlay;
  1145. { Demonstrate the PutPixel and GetPixel commands }
  1146. const
  1147.   Seed   = 1962; { A seed for the random number generator }
  1148.   NumPts = 2000; { The number of pixels plotted }
  1149.   Esc    = #27;
  1150. var
  1151.   I : word;
  1152.   X, Y, Color : word;
  1153.   XMax, YMax  : integer;
  1154.   ViewInfo    : ViewPortType;
  1155. begin
  1156.   MainWindow('PutPixel / GetPixel demonstration');
  1157.   StatusLine('Esc aborts or press a key...');
  1158.  
  1159.   GetViewSettings(ViewInfo);
  1160.   with ViewInfo do
  1161.   begin
  1162.     XMax := (x2-x1-1);
  1163.     YMax := (y2-y1-1);
  1164.   end;
  1165.  
  1166.   while not KeyPressed do
  1167.   begin
  1168.     { Plot random pixels }
  1169.     RandSeed := Seed;
  1170.     I := 0;
  1171.     while (not KeyPressed) and (I < NumPts) do
  1172.     begin
  1173.       Inc(I);
  1174.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  1175.     end;
  1176.  
  1177.     { Erase pixels }
  1178.     RandSeed := Seed;
  1179.     I := 0;
  1180.     while (not KeyPressed) and (I < NumPts) do
  1181.     begin
  1182.       Inc(I);
  1183.       X := Random(XMax)+1;
  1184.       Y := Random(YMax)+1;
  1185.       Color := GetPixel(X, Y);
  1186.         if Color = RandColor then
  1187.           PutPixel(X, Y, 0);
  1188.      end;
  1189.   end;
  1190.   WaitToGo;
  1191. end; { PutPixelPlay }
  1192.  
  1193. procedure PutImagePlay;
  1194. { Demonstrate the GetImage and PutImage commands }
  1195.  
  1196. const
  1197.   r  = 20;
  1198.   StartX = 100;
  1199.   StartY = 50;
  1200.  
  1201. var
  1202.   CurPort : ViewPortType;
  1203.  
  1204. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  1205. var
  1206.   Step : integer;
  1207. begin
  1208.   Step := Random(2*r);
  1209.   if Odd(Step) then
  1210.     Step := -Step;
  1211.   X := X + Step;
  1212.   Step := Random(r);
  1213.   if Odd(Step) then
  1214.     Step := -Step;
  1215.   Y := Y + Step;
  1216.  
  1217.   { Make saucer bounce off viewport walls }
  1218.   with CurPort do
  1219.   begin
  1220.     if (x1 + X + Width - 1 > x2) then
  1221.       X := x2-x1 - Width + 1
  1222.     else
  1223.       if (X < 0) then
  1224.         X := 0;
  1225.     if (y1 + Y + Height - 1 > y2) then
  1226.       Y := y2-y1 - Height + 1
  1227.     else
  1228.       if (Y < 0) then
  1229.         Y := 0;
  1230.   end;
  1231. end; { MoveSaucer }
  1232.  
  1233. var
  1234.   Pausetime : word;
  1235.   Saucer    : pointer;
  1236.   X, Y      : integer;
  1237.   ulx, uly  : word;
  1238.   lrx, lry  : word;
  1239.   Size      : word;
  1240.   I         : word;
  1241. begin
  1242.   ClearDevice;
  1243.   FullPort;
  1244.  
  1245.   { PaintScreen }
  1246.   ClearDevice;
  1247.   MainWindow('GetImage / PutImage Demonstration');
  1248.   StatusLine('Esc aborts or press a key...');
  1249.   GetViewSettings(CurPort);
  1250.  
  1251.   { DrawSaucer }
  1252.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  1253.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  1254.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  1255.   Circle(StartX+10, StartY-12, 2);
  1256.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  1257.   Circle(StartX-10, StartY-12, 2);
  1258.   SetFillStyle(SolidFill, MaxColor);
  1259.   FloodFill(StartX+1, StartY+4, GetColor);
  1260.  
  1261.   { ReadSaucerImage }
  1262.   ulx := StartX-(r+1);
  1263.   uly := StartY-14;
  1264.   lrx := StartX+(r+1);
  1265.   lry := StartY+(r div 3)+3;
  1266.  
  1267.   Size := ImageSize(ulx, uly, lrx, lry);
  1268.   GetMem(Saucer, Size);
  1269.   GetImage(ulx, uly, lrx, lry, Saucer^);
  1270. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  1271.  
  1272.   { Plot some "stars" }
  1273.   for I := 1 to 1000 do
  1274.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  1275.   X := MaxX div 2;
  1276.   Y := MaxY div 2;
  1277.   PauseTime := 70;
  1278.  
  1279.   { Move the saucer around }
  1280.   repeat
  1281. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  1282.      Delay(PauseTime);
  1283. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  1284.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  1285.   until KeyPressed;
  1286.   FreeMem(Saucer, size);
  1287.   WaitToGo;
  1288. end; { PutImagePlay }
  1289.  
  1290. procedure PolyPlay;
  1291. { Draw random polygons with random fill styles on the screen }
  1292. const
  1293.   MaxPts = 5;
  1294. type
  1295.   PolygonType = array[1..MaxPts] of PointType;
  1296. var
  1297.   Poly : PolygonType;
  1298.   I, Color : word;
  1299. begin
  1300.   MainWindow('FillPoly demonstration');
  1301.   StatusLine('Esc aborts or press a key...');
  1302.   repeat
  1303.     Color := RandColor;
  1304.     SetFillStyle(Random(11)+1, Color);
  1305.     SetColor(Color);
  1306.     for I := 1 to MaxPts do
  1307.       with Poly[I] do
  1308.       begin
  1309.         X := Random(MaxX);
  1310.         Y := Random(MaxY);
  1311.       end;
  1312.     FillPoly(MaxPts, Poly);
  1313.   until KeyPressed;
  1314.   WaitToGo;
  1315. end; { PolyPlay }
  1316.  
  1317. procedure FillStylePlay;
  1318. { Display all of the predefined fill styles available }
  1319. var
  1320.   Style    : word;
  1321.   Width    : word;
  1322.   Height   : word;
  1323.   X, Y     : word;
  1324.   I, J     : word;
  1325.   ViewInfo : ViewPortType;
  1326.  
  1327. procedure DrawBox(X, Y : word);
  1328. begin
  1329.   SetFillStyle(Style, MaxColor);
  1330.   with ViewInfo do
  1331.     Bar(X, Y, X+Width, Y+Height);
  1332.   Rectangle(X, Y, X+Width, Y+Height);
  1333.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  1334.   Inc(Style);
  1335. end; { DrawBox }
  1336.  
  1337. begin
  1338.   MainWindow('Pre-defined fill styles');
  1339.   GetViewSettings(ViewInfo);
  1340.   with ViewInfo do
  1341.   begin
  1342.     Width := 2 * ((x2+1) div 13);
  1343.     Height := 2 * ((y2-10) div 10);
  1344.   end;
  1345.   X := Width div 2;
  1346.   Y := Height div 2;
  1347.   Style := 0;
  1348.   for J := 1 to 3 do
  1349.   begin
  1350.     for I := 1 to 4 do
  1351.     begin
  1352.       DrawBox(X, Y);
  1353.       Inc(X, (Width div 2) * 3);
  1354.     end;
  1355.     X := Width div 2;
  1356.     Inc(Y, (Height div 2) * 3);
  1357.   end;
  1358.   SetTextJustify(LeftText, TopText);
  1359.   WaitToGo;
  1360. end; { FillStylePlay }
  1361.  
  1362. procedure FillPatternPlay;
  1363. { Display some user defined fill patterns }
  1364. const
  1365.   Patterns : array[0..11] of FillPatternType = (
  1366.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  1367.             OldColor which has a path of pixels of OldColor or NewColor
  1368.             with sides touching back to the seed point, (XSeed, YSeed).
  1369.             Therefore, only pixels of OldColor are modified and no other
  1370.             information is changed.
  1371.  
  1372.             SEE ALSO
  1373.  
  1374.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  1375.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  1376.             SETVIEW
  1377.  
  1378.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  1379.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  1380.             IF WHICHVGA = 0 THEN STOP
  1381.             DUMMY=RES640
  1382.             SETVIEW 100, 100, 539, 379
  1383.             FILLVIEW 10
  1384.             WHILE INKEY$ = ""
  1385.             WEND
  1386.             VIDEOMODESET VMODE
  1387.             END
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.                                                                          63
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.           FONTGETINFO
  1411.  
  1412.             PROTOTYPE
  1413.  
  1414.             SUB FONTGETINFO (Width%, Height%)
  1415.  
  1416.             INPUT
  1417.  
  1418.             no input parameters
  1419.     WEND
  1420.             MOUSEEXIT
  1421.             VIDEOMODESET VMODE
  1422.             END
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.                                                                          86
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.           MOUSECURSORDEFAULT
  1470.  
  1471.             PROTOTYPE
  1472.  
  1473.             SUB MOUSECURSORDEFAULT ()
  1474.  
  1475.             INPUT
  1476.  
  1477.             no input parameters
  1478.  
  1479.             OUTPUT
  1480.  
  1481.             no value returned
  1482.  
  1483.             USAGE
  1484.  
  1485.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  1486.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  1487. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  1488. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  1489. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  1490. $╤
  1491. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  1492. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  1493. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  1494.       end;
  1495.     end;
  1496.   end;
  1497.   WaitToGo;
  1498. end; { UserLineStylePlay }
  1499.  
  1500.  
  1501. procedure SayGoodbye;
  1502. { Say goodbye and then exit the program }
  1503. var
  1504.   ViewInfo : ViewPortType;
  1505. begin
  1506.   MainWindow('');
  1507.   GetViewSettings(ViewInfo);
  1508.   SetTextStyle(TriplexFont, HorizDir, 4);
  1509.   SetTextJustify(CenterText, CenterText);
  1510.   with ViewInfo do
  1511.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  1512.   StatusLine('Press any key to quit...');
  1513.   repeat until KeyPressed;
  1514. end; { SayGoodbye }
  1515.  
  1516.  
  1517. PROCEDURE SelectMode;
  1518. VAR
  1519.     choice1,choice2     : CHAR;
  1520.    xsize,ysize            : WORD;
  1521. BEGIN
  1522.     (* Let's select a mode *)
  1523.     ClrScr;
  1524.     WriteLn('VESADEMO:');
  1525.     WriteLn('1. 256 colors');
  1526.     WriteLn('2. 32768 colors');
  1527.     WriteLn('3. 65536 colors');
  1528.     WriteLn('4. 16777216 colors');
  1529.     WriteLn('Q uit');
  1530.     WriteLn;
  1531.     Write('Your choice: ');
  1532.     REPEAT
  1533.         ReadLn(choice1);
  1534.       IF choice1 <> '1' THEN BEGIN
  1535.           WriteLn('Sorry !');
  1536.          WriteLn('This demo wasn''t written for more as 256 colors !');
  1537.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  1538.          WriteLn('Switching to 256 colors.');
  1539.          choice1 := '1';
  1540.       END;
  1541.     UNTIL choice1 IN ['1'..'4','q'];
  1542.     IF choice1 = 'q' THEN Halt;
  1543.  
  1544.     WriteLn;
  1545.     WriteLn;
  1546.     WriteLn('a. 320x200');
  1547.     WriteLn('b. 640x480');
  1548.     WriteLn('c. 800x600');
  1549.     WriteLn('d. 1024x768');
  1550.     WriteLn('e. 1280x1024');
  1551.     WriteLn('Q uit');
  1552.     WriteLn;
  1553.     Write('Your choice: ');
  1554.     REPEAT
  1555.         ReadLn(choice2);
  1556.     UNTIL choice2 IN ['a'..'e','q'];
  1557.     IF choice2 = 'q' THEN Halt;
  1558.  
  1559.     CASE choice2 OF
  1560.         'a' : BEGIN
  1561.             xsize := 320;
  1562.             ysize := 200;
  1563.         END;
  1564.         'b' : BEGIN
  1565.             xsize := 640;
  1566.             ysize := 480;
  1567.         END;
  1568.         'c' : BEGIN
  1569.             xsize := 800;
  1570.             ysize := 600;
  1571.         END;
  1572.         'd' : BEGIN
  1573.             xsize := 1024;
  1574.             ysize := 768;
  1575.         END;
  1576.         'e' : BEGIN
  1577.             xsize := 1280;
  1578.             ysize := 1024;
  1579.         END;
  1580.     END;
  1581.     CASE choice1 OF
  1582.         '1' : mode := FindVesaMode(xsize,ysize,8);
  1583.         '2' : mode := FindVesaMode(xsize,ysize,15);
  1584.         '3' : mode := FindVesaMode(xsize,ysize,16);
  1585.         '4' : mode := FindVesaMode(xsize,ysize,24);
  1586.     END;
  1587.     IF mode = 0 THEN BEGIN
  1588.         WriteLn('No such mode could be found !');
  1589.         WriteLn('Switching to to 320x200.');
  1590.         ReadKey;
  1591.         mode := V320x200x256;
  1592.     END;
  1593. END;
  1594.  
  1595. begin { program body }
  1596.   SelectMode;
  1597.   Initialize;
  1598.   ReportStatus;
  1599.  
  1600. {  AspectRatioPlay; }
  1601.   FillEllipsePlay;
  1602.   SectorPlay;
  1603.   WriteModePlay;
  1604.  
  1605.   ColorPlay;
  1606.   { PalettePlay only intended to work on these drivers: }
  1607.   if (GraphDriver = EGA) or
  1608.       (GraphDriver = EGA64) or
  1609.       (GraphDriver = VGA) then
  1610.      PalettePlay;
  1611.   PutPixelPlay;
  1612. {  PutImagePlay; }
  1613.   RandBarPlay;
  1614.   BarPlay;
  1615.   Bar3DPlay;
  1616.   ArcPlay;
  1617.   CirclePlay;
  1618.   PiePlay;
  1619.   LineToPlay;
  1620.   LineRelPlay;
  1621. {  LineStylePlay; }
  1622. {  UserLineStylePlay; }
  1623.   TextDump;
  1624.   TextPlay;
  1625.   CrtModePlay;
  1626.   FillStylePlay;
  1627.   FillPatternPlay;
  1628.   PolyPlay;
  1629.   SayGoodbye;
  1630. {  CloseGraph; }
  1631.   CloseVesa;
  1632. end.
  1633. ***************************************************
  1634.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  1635.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  1636. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  1637. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  1638.     Color := RandColor;
  1639.     SetColor(Color);
  1640.     SetFillStyle(Random(CloseDotFill)+1, Color);
  1641.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  1642.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  1643.   until KeyPressed;
  1644.   WaitToGo;
  1645. end; { RandBarPlay }
  1646.  
  1647. procedure ArcPlay;
  1648. { Draw random arcs on the screen }
  1649. var
  1650.   MaxRadius : word;
  1651.   EndAngle : word;
  1652.   ArcInfo : ArcCoordsType;
  1653. begin
  1654.   MainWindow('Arc / GetArcCoords demonstration');
  1655.   StatusLine('Esc aborts or press a key');
  1656.   MaxRadius := MaxY div 10;
  1657.   repeat
  1658.     SetColor(RandColor);
  1659.     EndAngle := Random(360);
  1660.     SetLineStyle(SolidLn, 0, NormWidth);
  1661.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  1662.     GetArcCoords(ArcInfo);
  1663.     with ArcInfo do
  1664.     begin
  1665.       Line(X, Y, XStart, YStart);
  1666.       Line(X, Y, Xend, Yend);
  1667.     end;
  1668.   until KeyPressed;
  1669.   WaitToGo;
  1670. end; { ArcPlay }
  1671.  
  1672. procedure PutPixelPlay;
  1673. { Demonstrate the PutPixel and GetPixel commands }
  1674. const
  1675.   Seed   = 1962; { A seed for the random number generator }
  1676.   NumPts = 2000; { The number of pixels plotted }
  1677.   Esc    = #27;
  1678. var
  1679.   I : word;
  1680.   X, Y, Color : word;
  1681.   XMax, YMax  : integer;
  1682.   ViewInfo    : ViewPortType;
  1683. begin
  1684.   MainWindow('PutPixel / GetPixel demonstration');
  1685.   StatusLine('Esc aborts or press a key...');
  1686.  
  1687.   GetViewSettings(ViewInfo);
  1688.   with ViewInfo do
  1689.   begin
  1690.     XMax := (x2-x1-1);
  1691.     YMax := (y2-y1-1);
  1692.   end;
  1693.  
  1694.   while not KeyPressed do
  1695.   begin
  1696.     { Plot random pixels }
  1697.     RandSeed := Seed;
  1698.     I := 0;
  1699.     while (not KeyPressed) and (I < NumPts) do
  1700.     begin
  1701.       Inc(I);
  1702.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  1703.     end;
  1704.  
  1705.     { Erase pixels }
  1706.     RandSeed := Seed;
  1707.     I := 0;
  1708.     while (not KeyPressed) and (I < NumPts) do
  1709.     begin
  1710.       Inc(I);
  1711.       X := Random(XMax)+1;
  1712.       Y := Random(YMax)+1;
  1713.       Color := GetPixel(X, Y);
  1714.         if Color = RandColor then
  1715.           PutPixel(X, Y, 0);
  1716.      end;
  1717.   end;
  1718.   WaitToGo;
  1719. end; { PutPixelPlay }
  1720.  
  1721. procedure PutImagePlay;
  1722. { Demonstrate the GetImage and PutImage commands }
  1723.  
  1724. const
  1725.   r  = 20;
  1726.   StartX = 100;
  1727.   StartY = 50;
  1728.  
  1729. var
  1730.   CurPort : ViewPortType;
  1731.  
  1732. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  1733. var
  1734.   Step : integer;
  1735. begin
  1736.   Step := Random(2*r);
  1737.   if Odd(Step) then
  1738.     Step := -Step;
  1739.   X := X + Step;
  1740.   Step := Random(r);
  1741.   if Odd(Step) then
  1742.     Step := -Step;
  1743.   Y := Y + Step;
  1744.  
  1745.   { Make saucer bounce off viewport walls }
  1746.   with CurPort do
  1747.   begin
  1748.     if (x1 + X + Width - 1 > x2) then
  1749.       X := x2-x1 - Width + 1
  1750.     else
  1751.       if (X < 0) then
  1752.         X := 0;
  1753.     if (y1 + Y + Height - 1 > y2) then
  1754.       Y := y2-y1 - Height + 1
  1755.     else
  1756.       if (Y < 0) then
  1757.         Y := 0;
  1758.   end;
  1759. end; { MoveSaucer }
  1760.  
  1761. var
  1762.   Pausetime : word;
  1763.   Saucer    : pointer;
  1764.   X, Y      : integer;
  1765.   ulx, uly  : word;
  1766.   lrx, lry  : word;
  1767.   Size      : word;
  1768.   I         : word;
  1769. begin
  1770.   ClearDevice;
  1771.   FullPort;
  1772.  
  1773.   { PaintScreen }
  1774.   ClearDevice;
  1775.   MainWindow('GetImage / PutImage Demonstration');
  1776.   StatusLine('Esc aborts or press a key...');
  1777.   GetViewSettings(CurPort);
  1778.  
  1779.   { DrawSaucer }
  1780.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  1781.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  1782.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  1783.   Circle(StartX+10, StartY-12, 2);
  1784.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  1785.   Circle(StartX-10, StartY-12, 2);
  1786.   SetFillStyle(SolidFill, MaxColor);
  1787.   FloodFill(StartX+1, StartY+4, GetColor);
  1788.  
  1789.   { ReadSaucerImage }
  1790.   ulx := StartX-(r+1);
  1791.   uly := StartY-14;
  1792.   lrx := StartX+(r+1);
  1793.   lry := StartY+(r div 3)+3;
  1794.  
  1795.   Size := ImageSize(ulx, uly, lrx, lry);
  1796.   GetMem(Saucer, Size);
  1797.   GetImage(ulx, uly, lrx, lry, Saucer^);
  1798. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  1799.  
  1800.   { Plot some "stars" }
  1801.   for I := 1 to 1000 do
  1802.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  1803.   X := MaxX div 2;
  1804.   Y := MaxY div 2;
  1805.   PauseTime := 70;
  1806.  
  1807.   { Move the saucer around }
  1808.   repeat
  1809. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  1810.      Delay(PauseTime);
  1811. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  1812.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  1813.   until KeyPressed;
  1814.   FreeMem(Saucer, size);
  1815.   WaitToGo;
  1816. end; { PutImagePlay }
  1817.  
  1818. procedure PolyPlay;
  1819. { Draw random polygons with random fill styles on the screen }
  1820. const
  1821.   MaxPts = 5;
  1822. type
  1823.   PolygonType = array[1..MaxPts] of PointType;
  1824. var
  1825.   Poly : PolygonType;
  1826.   I, Color : word;
  1827. begin
  1828.   MainWindow('FillPoly demonstration');
  1829.   StatusLine('Esc aborts or press a key...');
  1830.   repeat
  1831.     Color := RandColor;
  1832.     SetFillStyle(Random(11)+1, Color);
  1833.     SetColor(Color);
  1834.     for I := 1 to MaxPts do
  1835.       with Poly[I] do
  1836.       begin
  1837.         X := Random(MaxX);
  1838.         Y := Random(MaxY);
  1839.       end;
  1840.     FillPoly(MaxPts, Poly);
  1841.   until KeyPressed;
  1842.   WaitToGo;
  1843. end; { PolyPlay }
  1844.  
  1845. procedure FillStylePlay;
  1846. { Display all of the predefined fill styles available }
  1847. var
  1848.   Style    : word;
  1849.   Width    : word;
  1850.   Height   : word;
  1851.   X, Y     : word;
  1852.   I, J     : word;
  1853.   ViewInfo : ViewPortType;
  1854.  
  1855. procedure DrawBox(X, Y : word);
  1856. begin
  1857.   SetFillStyle(Style, MaxColor);
  1858.   with ViewInfo do
  1859.     Bar(X, Y, X+Width, Y+Height);
  1860.   Rectangle(X, Y, X+Width, Y+Height);
  1861.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  1862.   Inc(Style);
  1863. end; { DrawBox }
  1864.  
  1865. begin
  1866.   MainWindow('Pre-defined fill styles');
  1867.   GetViewSettings(ViewInfo);
  1868.   with ViewInfo do
  1869.   begin
  1870.     Width := 2 * ((x2+1) div 13);
  1871.     Height := 2 * ((y2-10) div 10);
  1872.   end;
  1873.   X := Width div 2;
  1874.   Y := Height div 2;
  1875.   Style := 0;
  1876.   for J := 1 to 3 do
  1877.   begin
  1878.     for I := 1 to 4 do
  1879.     begin
  1880.       DrawBox(X, Y);
  1881.       Inc(X, (Width div 2) * 3);
  1882.     end;
  1883.     X := Width div 2;
  1884.     Inc(Y, (Height div 2) * 3);
  1885.   end;
  1886.   SetTextJustify(LeftText, TopText);
  1887.   WaitToGo;
  1888. end; { FillStylePlay }
  1889.  
  1890. procedure FillPatternPlay;
  1891. { Display some user defined fill patterns }
  1892. const
  1893.   Patterns : array[0..11] of FillPatternType = (
  1894.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  1895.             OldColor which has a path of pixels of OldColor or NewColor
  1896.             with sides touching back to the seed point, (XSeed, YSeed).
  1897.             Therefore, only pixels of OldColor are modified and no other
  1898.             information is changed.
  1899.  
  1900.             SEE ALSO
  1901.  
  1902.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  1903.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  1904.             SETVIEW
  1905.  
  1906.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  1907.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  1908.             IF WHICHVGA = 0 THEN STOP
  1909.             DUMMY=RES640
  1910.             SETVIEW 100, 100, 539, 379
  1911.             FILLVIEW 10
  1912.             WHILE INKEY$ = ""
  1913.             WEND
  1914.             VIDEOMODESET VMODE
  1915.             END
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.                                                                          63
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.           FONTGETINFO
  1939.  
  1940.             PROTOTYPE
  1941.  
  1942.             SUB FONTGETINFO (Width%, Height%)
  1943.  
  1944.             INPUT
  1945.  
  1946.             no input parameters
  1947.     WEND
  1948.             MOUSEEXIT
  1949.             VIDEOMODESET VMODE
  1950.             END
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.                                                                          86
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.           MOUSECURSORDEFAULT
  1998.  
  1999.             PROTOTYPE
  2000.  
  2001.             SUB MOUSECURSORDEFAULT ()
  2002.  
  2003.             INPUT
  2004.  
  2005.             no input parameters
  2006.  
  2007.             OUTPUT
  2008.  
  2009.             no value returned
  2010.  
  2011.             USAGE
  2012.  
  2013.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  2014.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  2015. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  2016. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  2017. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  2018. $╤
  2019. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  2020. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  2021. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  2022.       end;
  2023.     end;
  2024.   end;
  2025.   WaitToGo;
  2026. end; { UserLineStylePlay }
  2027.  
  2028.  
  2029. procedure SayGoodbye;
  2030. { Say goodbye and then exit the program }
  2031. var
  2032.   ViewInfo : ViewPortType;
  2033. begin
  2034.   MainWindow('');
  2035.   GetViewSettings(ViewInfo);
  2036.   SetTextStyle(TriplexFont, HorizDir, 4);
  2037.   SetTextJustify(CenterText, CenterText);
  2038.   with ViewInfo do
  2039.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  2040.   StatusLine('Press any key to quit...');
  2041.   repeat until KeyPressed;
  2042. end; { SayGoodbye }
  2043.  
  2044.  
  2045. PROCEDURE SelectMode;
  2046. VAR
  2047.     choice1,choice2     : CHAR;
  2048.    xsize,ysize            : WORD;
  2049. BEGIN
  2050.     (* Let's select a mode *)
  2051.     ClrScr;
  2052.     WriteLn('VESADEMO:');
  2053.     WriteLn('1. 256 colors');
  2054.     WriteLn('2. 32768 colors');
  2055.     WriteLn('3. 65536 colors');
  2056.     WriteLn('4. 16777216 colors');
  2057.     WriteLn('Q uit');
  2058.     WriteLn;
  2059.     Write('Your choice: ');
  2060.     REPEAT
  2061.         ReadLn(choice1);
  2062.       IF choice1 <> '1' THEN BEGIN
  2063.           WriteLn('Sorry !');
  2064.          WriteLn('This demo wasn''t written for more as 256 colors !');
  2065.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  2066.          WriteLn('Switching to 256 colors.');
  2067.          choice1 := '1';
  2068.       END;
  2069.     UNTIL choice1 IN ['1'..'4','q'];
  2070.     IF choice1 = 'q' THEN Halt;
  2071.  
  2072.     WriteLn;
  2073.     WriteLn;
  2074.     WriteLn('a. 320x200');
  2075.     WriteLn('b. 640x480');
  2076.     WriteLn('c. 800x600');
  2077.     WriteLn('d. 1024x768');
  2078.     WriteLn('e. 1280x1024');
  2079.     WriteLn('Q uit');
  2080.     WriteLn;
  2081.     Write('Your choice: ');
  2082.     REPEAT
  2083.         ReadLn(choice2);
  2084.     UNTIL choice2 IN ['a'..'e','q'];
  2085.     IF choice2 = 'q' THEN Halt;
  2086.  
  2087.     CASE choice2 OF
  2088.         'a' : BEGIN
  2089.             xsize := 320;
  2090.             ysize := 200;
  2091.         END;
  2092.         'b' : BEGIN
  2093.             xsize := 640;
  2094.             ysize := 480;
  2095.         END;
  2096.         'c' : BEGIN
  2097.             xsize := 800;
  2098.             ysize := 600;
  2099.         END;
  2100.         'd' : BEGIN
  2101.             xsize := 1024;
  2102.             ysize := 768;
  2103.         END;
  2104.         'e' : BEGIN
  2105.             xsize := 1280;
  2106.             ysize := 1024;
  2107.         END;
  2108.     END;
  2109.     CASE choice1 OF
  2110.         '1' : mode := FindVesaMode(xsize,ysize,8);
  2111.         '2' : mode := FindVesaMode(xsize,ysize,15);
  2112.         '3' : mode := FindVesaMode(xsize,ysize,16);
  2113.         '4' : mode := FindVesaMode(xsize,ysize,24);
  2114.     END;
  2115.     IF mode = 0 THEN BEGIN
  2116.         WriteLn('No such mode could be found !');
  2117.         WriteLn('Switching to to 320x200.');
  2118.         ReadKey;
  2119.         mode := V320x200x256;
  2120.     END;
  2121. END;
  2122.  
  2123. begin { program body }
  2124.   SelectMode;
  2125.   Initialize;
  2126.   ReportStatus;
  2127.  
  2128. {  AspectRatioPlay; }
  2129.   FillEllipsePlay;
  2130.   SectorPlay;
  2131.   WriteModePlay;
  2132.  
  2133.   ColorPlay;
  2134.   { PalettePlay only intended to work on these drivers: }
  2135.   if (GraphDriver = EGA) or
  2136.       (GraphDriver = EGA64) or
  2137.       (GraphDriver = VGA) then
  2138.      PalettePlay;
  2139.   PutPixelPlay;
  2140. {  PutImagePlay; }
  2141.   RandBarPlay;
  2142.   BarPlay;
  2143.   Bar3DPlay;
  2144.   ArcPlay;
  2145.   CirclePlay;
  2146.   PiePlay;
  2147.   LineToPlay;
  2148.   LineRelPlay;
  2149. {  LineStylePlay; }
  2150. {  UserLineStylePlay; }
  2151.   TextDump;
  2152.   TextPlay;
  2153.   CrtModePlay;
  2154.   FillStylePlay;
  2155.   FillPatternPlay;
  2156.   PolyPlay;
  2157.   SayGoodbye;
  2158. {  CloseGraph; }
  2159.   CloseVesa;
  2160. end.
  2161. ***************************************************
  2162.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  2163.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  2164. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ